package com.haoze.nurse.dao;

import com.haoze.nurse.model.EmrFileIndexEntity;
import com.haoze.nurse.model.FileIndexDataEntity;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.additional.dialect.oracle.InsertListMapper;
import tk.mybatis.mapper.common.BaseMapper;
import tk.mybatis.mapper.common.ConditionMapper;

public interface FileIndexDataEntityMapper extends
        BaseMapper<FileIndexDataEntity>,
        ConditionMapper<FileIndexDataEntity>,
        InsertListMapper<FileIndexDataEntity> {

    int insertDataListWithIndependentClob(@Param("fileIndex") EmrFileIndexEntity fileIndex, @Param("dataEntity") FileIndexDataEntity dataEntity);
    int insertDataListWithInlineClob(@Param("fileIndex") EmrFileIndexEntity fileIndex, @Param("dataEntity") FileIndexDataEntity dataEntity);

    void removeDeletedNodes(@Param("emrFileId") String emrFileId, @Param("dataVersion") Integer dataVersion);

    String getHealthNumByInpatNum(@Param("inpatNum") String inpatNum);

    Integer getPatientCount(@Param("healthNum") String healthNum);

    Integer insertIntoPatient(@Param("healthNum") String healthNum);

    Integer updateLastPatientLevel(@Param("healthNum") String healthNum);

    void deleteNodes(@Param("emrFileId") String emrFileId, @Param("parentFileIndexDataId") String parentFileIndexDataId);

    String getLevel(@Param("emrFileId") String emrFileId);

    int insert(@Param("fileIndexDataEntity") FileIndexDataEntity fileIndexDataEntity);
}
